package com.chen.apidriver.remote;

import com.chen.internalcommon.dto.Car;
import com.chen.internalcommon.dto.DriverUser;
import com.chen.internalcommon.dto.DriverUserWorkStatus;
import com.chen.internalcommon.dto.ResponseResult;
import com.chen.internalcommon.response.DriverUserExistsResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author chenLiuPing
 **/
@FeignClient("service-driver-user")
public interface ServiceDriverUserClient {

    /**
     * 更新司机信息
     * @param driverUser
     * @return
     */
    @PutMapping("/user")
    ResponseResult updateDriverUser(@RequestBody DriverUser driverUser);

    /**
     * 根据手机号查询司机信息
     * @param driverPhone
     * @return
     */
    @GetMapping("/check-driver/{driverPhone}")
    ResponseResult<DriverUserExistsResponse> getUser(@PathVariable("driverPhone") String driverPhone);

    @GetMapping("/car")
    ResponseResult<Car> getCarById(@RequestParam Long carId);

    /**
     * 修改司机工作状态
     */
    @PostMapping("/driver-user-work-status")
    ResponseResult changeWorkStatus(@RequestBody DriverUserWorkStatus driverUserWorkStatus);
}
